﻿<html lang="en">
<head>
	<title>extract</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script src="http://code.jquery.com/jquery-1.5.js"></script>
	<script language="JavaScript">

	function extractService(value){
	    reqStr = "http://localhost:1374/Service/service.svc/GetWebPageData";
		if (document.forms["form1"].alert.checked)
			alert (reqStr);
		$.ajax({
			url: reqStr,
			dataType: "jsonp",
			data: {url: value},
			success: function(data) {
				alert(data.content);
				document.documentElement.innerHTML = data.content;
			}
		});
	}
	</script>
</head>
<body>
	<form name="form1" onsubmit="return false;">
		<input type="button" value="Transform content" onclick="extractService(this.form.input.value);" />
		<input type="checkbox" name="alert"> alert request string?<br>
		<br />
		Nhap URL vao day: <br />
		<textarea cols="60" rows="10" name="input"></textarea>
	</form>
</body>
</html>